﻿using System.Reflection;

namespace SL8.SL
{
    internal class MethodDescriptor
    {
        public MethodDescriptor(MethodInfo methodInfo, ParameterInfo[] methodParams)
        {
            this.MethodInfo = methodInfo;
            this.Parameters = methodParams;
        }

        public bool HasParameters
        {
            get
            {
                if (this.Parameters == null)
                {
                    return false;
                }

                return (this.Parameters.Length > 0);
            }
        }

        public MethodInfo MethodInfo { get; private set; }

        public int ParameterCount
        {
            get
            {
                if (this.Parameters == null)
                {
                    return 0;
                }

                return this.Parameters.Length;
            }
        }

        public ParameterInfo[] Parameters { get; private set; }
    }
}
